package com.keke.beauty.utils.exception;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import com.keke.beauty.utils.pojo.Result;
import com.keke.beauty.utils.tools.ResultUtil;

import lombok.extern.slf4j.Slf4j;

@RestControllerAdvice
@Slf4j
public class RRExceptionHandler {

	@ExceptionHandler(Exception.class)
	public Result handleException(Exception e){
	    e.printStackTrace();
	    log.error(e.getMessage(), e);
		return ResultUtil.error("服务器出错，请联系管理员！");
	}

    @ExceptionHandler(RRException.class)
    public Result handleRRException(RRException e){
        return ResultUtil.error(e.getMsg());
    }

}